/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dw2;
import javax.swing.*;
import java.awt.*;

/**
 *
 * @author Amanda
 */
public class ImageButton extends JButton {
    //private Image image;
    private Icon icon;

    public ImageButton(Image image, String label, int width, int height){
        super(label);
        icon = new ImageIcon(image);
        setIcon(icon);
        setText(null);
        setActionCommand(label);
        setBorderPainted(false);
        setContentAreaFilled(false);
        Dimension size = new Dimension(width, height);
        setPreferredSize(size);
        setMaximumSize(size);
    }

}
